<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="../../js/tools/jquery-1.4.2.min.js"></script>
<style>
table{table-layout:fixed;font-size:12px;}
  tr{background-color:#F1F6F6;}
  td{border:1px solid #D9D9D9;color:black;padding:2px;}
</style>
<script type="text/javascript">
  function selectAd()
  {
      var adPage=$("#adPage").val();
      if(adPage!="")
      {
          if(adPage=="1")
          {
           var no=0;
           var html="";
           for(var i=0;i<6;i++ )
           {
              no++;
              html+="广告位"+(i+1)+"：<input type='file' name='upload' onchange='addImangeNo(this,"+no+")'/>&nbsp;&nbsp;网址：<input type='text' name='url' size='20' value='http://'/><br/>";
           }
           
           $("#upload").html(html);
          }else if(adPage=="2")
          {
	          var no=6;
	           var html="";
	           for(var i=0;i<2;i++ )
	           {
	              no++;
	              html+="广告位"+(i+1)+"：<input type='file' name='upload' onchange='addImangeNo(this,"+no+")'/>&nbsp;&nbsp;网址：<input type='text' name='url' size='20' value='http://' /><br/>";
	           }
	           $("#upload").html(html);
          }else if(adPage=="3")
          {
              var no=8;
	           var html="";
	           for(var i=0;i<2;i++ )
	           {
	              no++;
	             html+="广告位"+(i+1)+"：<input type='file' name='upload' onchange='addImangeNo(this,"+no+")'/>&nbsp;&nbsp;网址：<input type='text' name='url' size='20' value='http://' /><br/>";
	           }
	           $("#upload").html(html);
          }else if(adPage=="4")
          {
              var no=10;
	           var html="";
	           for(var i=0;i<2;i++ )
	           {
	              no++;
	              html+="广告位"+(i+1)+"：<input type='file' name='upload' onchange='addImangeNo(this,"+no+")'/>&nbsp;&nbsp;网址：<input type='text' name='url' size='20' value='http://' /><br/>";
	           }
	           $("#upload").html(html);
          }else if(adPage=="5")
          {
              var no=12;
	           var html="";
	           for(var i=0;i<1;i++ )
	           {
	              no++;
	              html+="广告位"+(i+1)+"：<input type='file' name='upload' onchange='addImangeNo(this,"+no+")'/>&nbsp;&nbsp;网址：<input type='text' name='url' size='20' value='http://' /><br/>";
	           }
	           $("#upload").html(html);
          }else if(adPage=="6")
          {
              var no=13;
	           var html="";
	           for(var i=0;i<2;i++ )
	           {
	              no++;
	              html+="广告位"+(i+1)+"：<input type='file' name='upload' onchange='addImangeNo(this,"+no+")'/>&nbsp;&nbsp;网址：<input type='text' name='url' size='20' value='http://' /><br/>";
	           }
	           $("#upload").html(html);
          }else if(adPage=="7")
          {
              var no=15;
	           var html="";
	           for(var i=0;i<1;i++ )
	           {
	              no++;
	              html+="广告位"+(i+1)+"：<input type='file' name='upload' onchange='addImangeNo(this,"+no+")'/>&nbsp;&nbsp;网址：<input type='text' name='url' size='20' value='http://' /><br/>";
	           }
	           $("#upload").html(html);
          }else if(adPage=="8")
          {
              var no=16;
	           var html="";
	           for(var i=0;i<4;i++ )
	           {
	              no++;
	              html+="广告位"+(i+1)+"：<input type='file' name='upload' onchange='addImangeNo(this,"+no+")'/>&nbsp;&nbsp;网址：<input type='text' name='url' size='20' value='http://' /><br/>";
	           }
	           $("#upload").html(html);
          }
      
      }else
      {
          $("#upload").html("");
      }
  }
  function addImangeNo(obj,no)
  {
     var html="<input type='hidden' name='adImage' value='"+no+"'>";
     
     $("#hiddenInfor").append(html);
  }
  function beforeSubmit()
  {
    
     return true;
  }
</script>
</head>
<body>
 <form action="admin/system/systeminfor!addAd.action" method="post" enctype ="multipart/form-data" onsubmit="return beforeSubmit();">
 <div id="hiddenInfor" style="display:none;">
 
 </div>
 <table width="80%" height="277" align="center"  style="width:80%;">
 <tr><td width="55%">广告页面：
      <select onchange="selectAd()" id="adPage">
         <option value="">请选择</option>
         <option value="1">首页面</option>
         <option value="2">分类团购</option>
         <option value="3">往期团购</option>
         <option value="4">品牌主页面</option>
         <option value="5">品牌用户页面</option>
         <option value="6">往期团购更多</option>
         <option value="7">话题回复页面</option>
         <option value="8">登录页面</option>
      </select>
      </td>
   <td width="45%" rowspan="2"><img width="398" height="227" src=""/></td>
 </tr>
  <tr>
     <td height="161">
       <div id="upload"></div>
     </td>
    </tr>
  <tr>
    <td colspan="2"  align="center">
       <input type="submit" value="确定">    </td>
    </tr>
</table>
</form>
</body>
</html>
